package com.ruoyi.web.controller.system;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.domain.SyncServer;
import com.ruoyi.system.service.ISyncServerService;

/**
 * 服务器信息 控制层
 * 
 * @author ruoyi
 */
@RestController
@RequestMapping("/system/server")
public class SysServerController extends BaseController
{
    @Autowired
    private ISyncServerService syncServerService;
    
    /**
     * 获取服务器列表
     */
    @PreAuthorize("@ss.hasPermi('system:dbconfig:list')")
    @GetMapping("/list")
    public TableDataInfo list(SyncServer syncServer)
    {
        startPage();
        // 只查询数据库类型的服务器
        syncServer.setServerType("0"); 
        List<SyncServer> list = syncServerService.selectSyncServerList(syncServer);
        return getDataTable(list);
    }
} 